package com.etc.team2.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import com.etc.team2.jdbc.JDBCHelper;
public class ManagerDAO {
	private ResultSet set;
	private JDBCHelper helper;
	
	public ManagerDAO()
	{
		helper=new JDBCHelper();
	}
	
	public ResultSet IsManagerExist(String managerName, String password) {// 根据登陆名和密码搜索管理员，如不存在ResultSet=null
		Object[] objects = new Object[] { managerName, password };
		String sql = "select * from bus_manager_info where ManagerName=? and Password=? ";
		set = helper.executeQueryByPrepareStatement(sql, objects);
		try {
			if (set.next()) {
				return set;
			} else {
				return null;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

}
